<!doctype html>
<html lang="en" class="fixed sidebar-left-collapsed" xmlns:th="http://www.thymeleaf.org">
<head>

    <!-- Basic -->
    <meta charset="UTF-8">

    <title>分配教练</title>

    <!-- Web Fonts  -->
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light" rel="stylesheet" type="text/css">

    <!-- Vendor CSS -->
    <link rel="stylesheet" th:href="@{/vendor/bootstrap/css/bootstrap.css}" />
    <link rel="stylesheet" th:href="@{/vendor/font-awesome/css/font-awesome.css}" />
    <link rel="stylesheet" th:href="@{/vendor/magnific-popup/magnific-popup.css}" />
    <link rel="stylesheet" th:href="@{/vendor/bootstrap-datepicker/css/datepicker3.css}" />

    <!-- Specific Page Vendor CSS -->
    <link rel="stylesheet" th:href="@{/vendor/select2/select2.css}" />
    <link rel="stylesheet" th:href="@{/vendor/jquery-datatables-bs3/assets/css/datatables.css}" />


    <!-- Theme CSS -->
    <link rel="stylesheet" th:href="@{/stylesheets/theme.css}" />

    <!-- Skin CSS -->
    <link rel="stylesheet" th:href="@{/stylesheets/skins/default.css}" />

    <!-- Theme Custom CSS -->
    <link rel="stylesheet" th:href="@{/stylesheets/theme-custom.css}">

    <!-- Head Libs -->
    <script th:src="@{/vendor/modernizr/modernizr.js}"></script>

</head>
<body>
<section class="body">

    <!-- 头部 -->
    <div th:replace="~{commons/commons::header}"></div>

    <div class="inner-wrapper">

        <!-- 左侧边栏 -->
        <div th:replace="~{commons/commons::sidebar-admin}"></div>

        <!-- 主体 -->
        <section role="main" class="content-body">
            <header class="page-header">
                <h2>分配教练</h2>

                <div th:if="${user.getUserType() == 0}" class="right-wrapper pull-right">
                    <ol class="breadcrumbs">
                        <li>
                            <a th:href="@{/main.html}">
                                <i class="fa fa-home"></i>
                            </a>
                        </li>
                        <li><span>学员管理</span></li>
                        <li><span>分配教练</span></li>
                        <li><span>分配教练</span></li>
                    </ol>

                    <a class="sidebar-right-toggle" data-open="sidebar-right"><i class="fa fa-chevron-left"></i></a>
                </div>
            </header>

            <!-- start: page -->
            <section class="panel">
                <header class="panel-heading">
                    <div class="panel-actions">
                        <a href="#" class="fa fa-caret-down"></a>
                        <a href="#" class="fa fa-times"></a>
                    </div>

                    <h2 class="panel-title">分配教练</h2>
                </header>
                <div class="panel-body">
                    <form th:action="@{/distributeTrainer}" class="form-horizontal form-bordered" method="post">

                        <div class="form-group">
                            <label class="col-md-3 control-label" for="name">姓名</label>
                            <div class="col-md-6">
                                <input type="text" class="form-control" placeholder="姓名" name="name" id="name" th:value="${user.getName()}" readonly="readonly">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-3 control-label">性别</label>
                            <div class="col-md-6">
                                <div class="radio">
                                    <label>
                                        <input  th:checked="${user.getSex() == 1}"  type="radio" name="sex" id="sex_1" value="1" disabled="disabled">男
                                    </label>
                                </div>
                                <div class="radio">
                                    <label>
                                        <input  th:checked="${user.getSex() == 0}"  type="radio" name="sex" id="sex_0" value="0" disabled="disabled">女
                                    </label>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-3 control-label" for="card">身份证号</label>
                            <div class="col-md-6">
                                <input type="text" class="form-control" placeholder="身份证号" name="card" id="card" th:value="${user.getCard()}" readonly="readonly">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-3 control-label" for="phone">手机号</label>
                            <div class="col-md-6">
                                <input type="text" class="form-control" placeholder="手机号" name="phone" id="phone" th:value="${user.getPhone()}" readonly="readonly">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-3 control-label" for="distributionSubjectTwoTrainerId">科目二教练</label>
                            <div class="col-md-6">
                                <select class="form-control mb-md" name="distributionSubjectTwoTrainerId" id="distributionSubjectTwoTrainerId">
                                    <option th:selected="${user.getDistributionSubjectTwoTrainerId() == null}" th:value="null">暂无教练</option>
                                    <option th:selected="${trainer.getUserId().equals(user.getDistributionSubjectTwoTrainerId())}"
                                            th:each="trainer:${trainer_2}" th:text="${trainer.getName() + '(' + trainer.getUserId() + ')'}" th:value="${trainer.getUserId()}"></option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-3 control-label" for="distributionSubjectThreeTrainerId">科目三教练</label>
                            <div class="col-md-6">
                                <select class="form-control mb-md" name="distributionSubjectThreeTrainerId" id="distributionSubjectThreeTrainerId">
                                    <option th:selected="${user.getDistributionSubjectThreeTrainerId() == null}" th:value="null">暂无教练</option>
                                    <option th:selected="${trainer.getUserId().equals(user.getDistributionSubjectThreeTrainerId())}"
                                            th:each="trainer:${trainer_3}" th:text="${trainer.getName() + '(' + trainer.getUserId() + ')'}" th:value="${trainer.getUserId()}"></option>
                                </select>
                            </div>
                        </div>

                        <input type="hidden" name="userId" th:value="${user.getUserId()}">
                        <input type="hidden" name="userType" th:value="${user.getUserType()}">
                        <input type="hidden" name="parent" th:value="${user.getParent()}">

                        <div class="form-group">
                            <label class="col-md-3 control-label"></label>
                            <div class="col-md-6">
                                <p style="color:red;font-size: large;" th:text="${msg}"></p>
                            </div>
                        </div>

                        <div class="panel-footer">
                            <div class="row">
                                <div class="col-md-9 col-md-offset-3">
                                    <button type="submit" class="btn btn-primary">修改</button>
                                    <button type="reset" class="btn btn-default">重置</button>
                                    <a th:href="@{/distribute_trainer}" class="btn btn-default">取消</a>
                                </div>
                            </div>
                        </div>

                    </form>
                </div>
            </section>
            <!-- end: page -->

        </section>
    </div>

    <!-- 右侧边栏 -->
    <div th:replace="~{commons/commons::sidebar-right}"></div>
</section>

<!-- Vendor -->
<script th:src="@{vendor/jquery/jquery.js}"></script>
<script th:src="@{vendor/jquery-browser-mobile/jquery.browser.mobile.js}"></script>
<script th:src="@{/vendor/bootstrap/js/bootstrap.js}"></script>
<script th:src="@{vendor/nanoscroller/nanoscroller.js}"></script>
<script th:src="@{vendor/bootstrap-datepicker/js/bootstrap-datepicker.js}"></script>
<script th:src="@{vendor/magnific-popup/magnific-popup.js}"></script>
<script th:src="@{vendor/jquery-placeholder/jquery.placeholder.js}"></script>

<!-- Specific Page Vendor -->
<script th:src="@{/vendor/select2/select2.js}"></script>
<script th:src="@{/vendor/jquery-datatables/media/js/jquery.dataTables.js}"></script>
<script th:src="@{/vendor/jquery-datatables/extras/TableTools/js/dataTables.tableTools.min.js}"></script>
<script th:src="@{/vendor/jquery-datatables-bs3/assets/js/datatables.js}"></script>

<!-- Theme Base, Components and Settings -->
<script th:src="@{/javascripts/theme.js}"></script>

<!-- Theme Custom -->
<script th:src="@{/javascripts/theme.custom.js}"></script>

<!-- Theme Initialization Files -->
<script th:src="@{/javascripts/theme.init.js}"></script>

<!-- Examples -->
<script th:src="@{/javascripts/tables/examples.datatables.editable.js}"></script>
<script th:src="@{/javascripts/tables/examples.datatables.default.js}"></script>
<script th:src="@{/javascripts/tables/examples.datatables.row.with.details.js}"></script>
<script th:src="@{/javascripts/tables/examples.datatables.tabletools.js}"></script>

</body>
</html>